<template>
    <div>
      <div style="display:flex;align-items: center;height:40px;justify-content: center;font-size:16px;background:rgb(18,183,245);color:white">
         活动提示
      </div>
      <div
           style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
         <span style="">1.不要使用花呗，淘金币红包，以及任何返利软件，淘立拍也不可以使用，发现的话立刻封号</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
          <span style="">2.一定按照关键词搜索找不到问管理，不要乱改关键词</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
          <span style="">3.浏览要认真，对大家都好</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
          <span style="">4.假聊时候就和你自己买东西是一样的，不要太假！！！</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
         <span style="">5.看清商家要求做活动，不要自己乱搞</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
         <span style="">6.记得货到，签收好评</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
          <span style="">7.有的商家是自己审核会在24h内返款不要着急</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
          <span style="">8.不要退款!不要退款！不要退款！退款会封号</span>
        </div>
      </div>
      <div
        style="display:flex;align-items: center;margin-top:10px;justify-content: space-around;border-bottom:1px solid #bababa;padding-bottom:10px;">
        <div style="font-size:16px;width:90%;text-align:left">
          <span style="">9.有任何问题找师傅，师傅不可以就管理都会解决的</span>
        </div>
      </div>
      <div style="width:100%;text-align: center;border-bottom:1px solid #bababa">
        <van-button type="info" size="normal" style="margin:10px auto;width:70%" @click="ondraw()" v-if="count == 0">开始活动</van-button>
        <van-button type="default" size="normal" style="margin:10px auto;width:70%;background:gray;color:white;" v-else>开始活动</van-button>
      </div>
      <van-dialog v-model="show" title="信息通知" :showConfirmButton="false">
        <div style="width:90%;height:150px;margin:0 auto;display:flex;flex-direction: column;align-items: center;">
          <span style="color:red;font-size:16px;text-indent:30px;margin-top:20px;">切记不要使用花呗，淘金币红包，以及任何返利软件，淘立拍也不可以使用，发现的话立刻封号</span>
          <span style="width:20px;margin-top:20px;">{{count}}</span>
        </div>
      </van-dialog>
      <div style="width:95%;margin:10px auto;display:flex;justify-content:space-between;align-items: center;height:40px;">
         <span style="font-size:16px;">本金佣金返款流程：</span>
         <van-button type="info" size="small" @click="Look_pic">查看图片</van-button>
      </div>
    </div>
</template>

<script>
    import {identifytask} from "../api/api";
    import aestool from '@/utils/aestool.js';
    export default {
        name: "task-begin",
      data(){
          return{
            show:false,
            count:5
          }
      },
      methods:{
        Look_pic(){
          this.$toast('暂无教程')
        },
        countDown() {
          let clock = window.setInterval(() => {
            this.count--
            if(this.count<=0){
              window.clearInterval(clock)
              this.show = false
            }
          },1000)
        },
        getNum() {
          var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
          var nums = ""
          for (var i = 0; i < 16; i++) {
            var id = parseInt(Math.random() * 61);
            nums += chars[id];
          }
          return nums
        },
        //领取活动
        ondraw() {
          let toastload = this.$toast.loading({
            message: '加载中...',
            forbidClick: true
          });
          let str = this.getNum()
          let params = {
            data: aestool.encrypt('Identifytask_4', str),
            data_s: aestool.encrypt(str, '123456asdzxcqwe0'),
          }
          identifytask(params).then(res => {
            toastload.clear()
            if (res.Status == 200) {
              this.showready = false
              this.$toast(res.Message)
              setTimeout(() => {
                this.$router.push('/taskdetail')
              }, 1500);
            } else {
              this.$toast(res.Message)
            }
          })
        },
      },
      created() {
          this.countDown()
      }
    }
</script>

<style>

</style>
